1. Field of the Invention
The present invention relates to file locking and more particularly to managing long-lived resource locks in a resource locking mechanism.
2. Description of the Related Art
Electronic mail, referred to in the art as e-mail, has proven to be the most widely used computing application globally. Though e-mail has been a commercial staple for several decades, due to the explosive popularity and global connectivity of the Internet, e-mail has become the preferred mode of asynchronous communications, regardless of the geographic separation of communicating parties. Today, more e-mails are processed in a single hour than phone calls. Clearly, e-mail as an asynchronous mode of communications has been postured to replace all other modes of communications excepting voice telephony.
Conventional e-mail processing involves the intermediate and long-term storage of messages in a data store of e-mail messages. For a single user system, managing the data store of e-mail messages can be as simple as managing a series of directory folders in a basic operating system. Larger, distributed corporate e-mail processing differs somewhat from more basic e-mail management systems in that multiple parties can access the functionality and data for the e-mail processing system. Accordingly, in the larger, corporate setting, e-mail messages can be disposed temporarily and permanently in a database management system which can be configured for a high volume transactional environment.
Large corporate e-mail and data processing demands can exceed the capabilities of even the most powerful computing systems. Of paramount importance, access to e-mail resources must be coordinated between different computing devices in order to avoid a race condition for accessing the same resource simultaneously by the different computing devices. Current solutions for coordination access to data between multiple machines include the use of file system file locks or database row locks. When using file system locks or database row locks, once a user access a resource, the resource can be locked from use by other users. Only when the accessing user releases the resource can the other users compete to access the resource.
Thus, using locks, one can achieve a level of synchronization between different computing devices to a shared resource. Notably, if a computing process that has declared ownership of a resource through a lock suddenly becomes nonfunctional, a mechanism is required that can release ownership of the resource from the nonfunctional process so that the resource can be processed by another process. A common solution to an orphaned lock is to utilize a lock time stamp to indicate when ownership over the resource was declared. After a threshold period of time has elapsed, the lock can be released, irrespective of the health of the owning process.
This common approach has a problem in that determining the expiration threshold for how old locks can be before they are considered stale is error prone. If the threshold is too short, the stale lock detection process may clear a resource lock still required by an active process. In contrast, if the threshold is too long, resources that have been abandoned by the process can linger unprocessed for an extended period of time which can introduce substantial latencies in the computing system. In the e-mail context, these inefficiencies can result in the failure to timely deliver a message.